In [1]:
%cd ..
import Librairie.AL_Fct as al
%cd "Chapitre 5 - Applications lineaires"
import numpy as np
from IPython.display import display, Markdown, Latex
import plotly.graph_objs as go
import plotly
import ipywidgets as widgets
from ipywidgets import interact, interactive, fixed, interact_manual
from ipywidgets import Layout, HBox, VBox, Label
#import matplotlib
#import plotly.express as px
/Users/mac/Desktop/bosse/CEDE/jupyter-notebooks-for-linear-algebra
/Users/mac/Desktop/bosse/CEDE/jupyter-notebooks-for-linear-algebra/Chapitre 5 - Applications lineaires
Concept(s)-clé(s)¶
THÉORÈME DU RANG :¶
Soient $𝑉$,$𝑊$ deux ℝ-espaces vectoriels et $𝑇:𝑉 \rightarrow𝑊$ une application linéaire. Si 𝑉 est de dimension finie, alors $im(𝑇)$ est de dimension finie et $\mbox{dim} V=\mbox{dim} (\mbox{ker} (T)) + \mbox{dim}( \mbox{im} (T)).$
Conséquences :¶
- $dim(Im(T)) = dim(V) - dim(ket(T)) \rightarrow dim(Im(T)) \leq dim(V)$
- Si $T$ est injectie, $ker(T) = {0}$, $ dim(V) = dim(Im(T)) \leq dim(W)$
- Si $T$ est surjective, $W = im(T)$, $ dim(V) = dim(W) \leq dim(V)$
EXERCICE 1¶
Soit l'application $T:\mathbb{R}_2 \rightarrow \mathbb{P}_3(\mathbb{R}_2)$
$T(a,b) = a+ax+bx^2-(a+b)x^3$
1.1 $T$ peut-elle être surjective ?
In [2]:
def exercise_1_1():
radio = widgets.RadioButtons(
options=['Oui', 'Non'],
description='Réponse:',
disabled=False
)
button = widgets.Button(description='Vérifier')
out = widgets.Output()
def callback(e):
out.clear_output()
with out:
if (radio.value == "Oui"):
display(Markdown('Mauvaise réponse.'))
else:
display(Markdown('Correct !'))
display(Latex("L'une des conséquences du théorème du rang est la suivante: si $T:V \Rightarrow W$ est surjective, cela signifie que $W = im(T)$ et par le théorème du rang $dim(W) \leq dim(V)$, mais dans notre cas $dim(W) > dim(V)$"))
button.on_click(callback)
display(radio)
display(button)
display(out)
exercise_1_1()
<>:19: SyntaxWarning: invalid escape sequence '\R'
<>:19: SyntaxWarning: invalid escape sequence '\R'
/var/folders/mb/_rmmnpbs429cs4tdy6c94sp40000gn/T/ipykernel_10714/2125341368.py:19: SyntaxWarning: invalid escape sequence '\R'
display(Latex("L'une des conséquences du théorème du rang est la suivante: si $T:V \Rightarrow W$ est surjective, cela signifie que $W = im(T)$ et par le théorème du rang $dim(W) \leq dim(V)$, mais dans notre cas $dim(W) > dim(V)$"))
1.2 $T$ Est elle injective ?
In [3]:
def exercise_1_2():
radio = widgets.RadioButtons(
options=['Oui', 'Non'],
description='Réponse:',
disabled=False
)
button = widgets.Button(description='Vérifier')
solution_btn = widgets.Button(description='Solution', disabled = True)
box = HBox([button, solution_btn])
out = widgets.Output()
def callback(e):
out.clear_output()
with out:
if (radio.value == "Non"):
display(Markdown('Mauvaise réponse.'))
else:
display(Markdown('Correct !'))
solution_btn.disabled = False
def solution(b):
with out:
display(Markdown("En remarque que si $T(a,b) = 0$ alors $a=b=0$, ce qui signifie que $ker(T) = 0 $. Ainsi, T est injective"))
button.on_click(callback)
solution_btn.on_click(solution)
display(radio)
display(box)
display(out)
exercise_1_2()
EXERCICE 2¶
Soit l'application $T:M_{2 \times 2}(\mathbb{R})\rightarrow \mathbb{R}_3 $
$T\begin{pmatrix}\begin{pmatrix}a & b \\ c& d \end{pmatrix}\end{pmatrix} = \begin{pmatrix} a+b \\c+d \\ c-d \end{pmatrix}$
1.1 $T$ peut-elle être injective ?
In [4]:
def exercise_2_1():
radio = widgets.RadioButtons(
options=['Oui', 'Non'],
description='Réponse:',
disabled=False
)
button = widgets.Button(description='Vérifier')
out = widgets.Output()
def callback(e):
out.clear_output()
with out:
if (radio.value == "Oui"):
display(Markdown('Mauvaise réponse.'))
else:
display(Markdown('Correct !'))
display(Markdown("L'une des conséquences du théorème du rang est la suivante: si $T:V \Rightarrow W$ est injective, cela signifie que $ker(T) = 0$ et donc, par le théorème du rang, $dim(V) = dim(im(T)) \leq dim(W)$, mais dans notre cas $dim(V) > dim(W)$"))
button.on_click(callback)
display(radio)
display(button)
display(out)
exercise_2_1()
<>:19: SyntaxWarning: invalid escape sequence '\R'
<>:19: SyntaxWarning: invalid escape sequence '\R'
/var/folders/mb/_rmmnpbs429cs4tdy6c94sp40000gn/T/ipykernel_10714/3589252976.py:19: SyntaxWarning: invalid escape sequence '\R'
display(Markdown("L'une des conséquences du théorème du rang est la suivante: si $T:V \Rightarrow W$ est injective, cela signifie que $ker(T) = 0$ et donc, par le théorème du rang, $dim(V) = dim(im(T)) \leq dim(W)$, mais dans notre cas $dim(V) > dim(W)$"))
2.2 $T$ est-elle surjective ? Pour répondre a cette question, trouvez le noyau de T puis utilisez le théorème du rang
In [5]:
def exercise_2_2():
radio = widgets.RadioButtons(
options=['Oui', 'Non'],
description='Réponse:',
disabled=False
)
button = widgets.Button(description='Vérifier')
solution_btn = widgets.Button(description='Solution', disabled = True)
box = HBox([button, solution_btn])
out = widgets.Output()
def callback(e):
out.clear_output()
with out:
if (radio.value == "Oui"):
display(Markdown('Mauvaise réponse.'))
else:
display(Markdown('Correct !'))
solution_btn.disabled = False
def solution(b):
with out:
display(Markdown("Le noyau de $T$ est définit par : $$ ker(T) = \\Bigg\{ \\begin{pmatrix}a & b \\\ c& d \\end{pmatrix} \\Bigg| \\begin{pmatrix} a+b \\\ c+d \\\ c-d \\end{pmatrix} = \\begin{pmatrix} 0 \\\ 0 \\\ 0 \\end{pmatrix} \\Bigg\}$$"))
display(Markdown("Il correspond donc au système suivant: $\\begin{equation}\left\{\\begin{aligned} a+b = 0 \\\ c+d = 0 \\\ c-d = 0 \end{aligned}\\right.\end{equation}$ $\\rightarrow$ $\\begin{equation}\left\{\\begin{aligned} a = -b \\\ c = 0 \\\ d = 0 \end{aligned}\\right.\end{equation}$"))
display(Markdown("Ainsi, $$ ker(T) = \\Bigg\{ \\begin{pmatrix}a & -a \\\ 0 & 0 \\end{pmatrix} \\Bigg| \\quad a \in \mathbb{R} \\Bigg\}$$"))
button.on_click(callback)
solution_btn.on_click(solution)
display(radio)
display(box)
display(out)
exercise_2_2()
<>:25: SyntaxWarning: invalid escape sequence '\{'
<>:26: SyntaxWarning: invalid escape sequence '\l'
<>:27: SyntaxWarning: invalid escape sequence '\{'
<>:25: SyntaxWarning: invalid escape sequence '\{'
<>:26: SyntaxWarning: invalid escape sequence '\l'
<>:27: SyntaxWarning: invalid escape sequence '\{'
/var/folders/mb/_rmmnpbs429cs4tdy6c94sp40000gn/T/ipykernel_10714/3119811584.py:25: SyntaxWarning: invalid escape sequence '\{'
display(Markdown("Le noyau de $T$ est définit par : $$ ker(T) = \\Bigg\{ \\begin{pmatrix}a & b \\\ c& d \\end{pmatrix} \\Bigg| \\begin{pmatrix} a+b \\\ c+d \\\ c-d \\end{pmatrix} = \\begin{pmatrix} 0 \\\ 0 \\\ 0 \\end{pmatrix} \\Bigg\}$$"))
/var/folders/mb/_rmmnpbs429cs4tdy6c94sp40000gn/T/ipykernel_10714/3119811584.py:26: SyntaxWarning: invalid escape sequence '\l'
display(Markdown("Il correspond donc au système suivant: $\\begin{equation}\left\{\\begin{aligned} a+b = 0 \\\ c+d = 0 \\\ c-d = 0 \end{aligned}\\right.\end{equation}$ $\\rightarrow$ $\\begin{equation}\left\{\\begin{aligned} a = -b \\\ c = 0 \\\ d = 0 \end{aligned}\\right.\end{equation}$"))
/var/folders/mb/_rmmnpbs429cs4tdy6c94sp40000gn/T/ipykernel_10714/3119811584.py:27: SyntaxWarning: invalid escape sequence '\{'
display(Markdown("Ainsi, $$ ker(T) = \\Bigg\{ \\begin{pmatrix}a & -a \\\ 0 & 0 \\end{pmatrix} \\Bigg| \\quad a \in \mathbb{R} \\Bigg\}$$"))